package com.baiyi.cloud.platform.db.config.util;


/**
 * 
 * @ClassName: DataSourceHolder
 * @Description: 用于数据源切换
 * @author huwenfeng
 * @date 2019年1月7日
 */
public class DataSourceHolder {

    private static final ThreadLocal<DataSourceKey> dataSourceKey = new ThreadLocal<>();

    public static DataSourceKey getDataSourceKey() {
        return dataSourceKey.get();
    }

    public static void setDataSourceKey(DataSourceKey type) {
        dataSourceKey.set(type);
    }

    public static void clearDataSourceKey() {
        dataSourceKey.remove();
    }


}